using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;

namespace SportsStore.Models
{
  public class ApplicationDbContext:DbContext
  {
    public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) : base(options) { }
    public DbSet<Prodct> Products { get; set; }
    public DbSet<Order> Orders { get; set; }
  }
  public class ApplicationDbContextFactory : IDesignTimeDbContextFactory<ApplicationDbContext>
  {
    public ApplicationDbContext CreateDbContext(string[] args) =>
      Program.BuildWebHost(args).Services.GetRequiredService<ApplicationDbContext>();
  }
}
